package demo.swing.passenger;

import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class EnterPassenger extends JFrame {
	JLabel nameLabel = null;
	JLabel surnameLabel = null;
	JLabel patronymicLabel = null;
	JLabel passportLabel = null;
	JLabel nationalityLabel = null;
	JTextField nameValue = null;
	JTextField surname = null;
	JTextField patronymic = null;
	JTextField passport = null;
	JTextField nationality = null;
	
	public EnterPassenger(String title){
		super(title);
		setNameLabel(new JLabel("Name:"));
		setSurnameLabel(new JLabel("Surname:"));
		setPatronymicLabel(new JLabel("Patronymic:"));
		setNationalityLabel(new JLabel("Nationality:"));
		setPassportLabel(new JLabel("Passport number:"));
		setNameValue(new JTextField());
		setSurname(new JTextField());
		setPatronymic(new JTextField());
		setPassport(new JTextField("00 00 000000"));
		setNationality(new JTextField("Russia"));
		setOkBtn(new JButton("The data are filled."));
		this.setLayout(new GridLayout(6, 2));
		this.add(getNameLabel());
		this.add(getNameValue());
		this.add(getSurnameLabel());
		this.add(getSurname());
		this.add(getPatronymicLabel());
		this.add(getPatronymic());
		this.add(getNationalityLabel());
		this.add(getNationality());
		this.add(getPassportLabel());
		this.add(getPassport());
		this.add(getOkBtn());
	}
	JButton okBtn = null;
	public JLabel getNameLabel() {
		return nameLabel;
	}
	public void setNameLabel(JLabel nameLabel) {
		this.nameLabel = nameLabel;
	}
	public JLabel getSurnameLabel() {
		return surnameLabel;
	}
	public void setSurnameLabel(JLabel surnameLabel) {
		this.surnameLabel = surnameLabel;
	}
	public JLabel getPatronymicLabel() {
		return patronymicLabel;
	}
	public void setPatronymicLabel(JLabel patronymicLabel) {
		this.patronymicLabel = patronymicLabel;
	}
	public JLabel getPassportLabel() {
		return passportLabel;
	}
	public void setPassportLabel(JLabel passportLabel) {
		this.passportLabel = passportLabel;
	}
	public JLabel getNationalityLabel() {
		return nationalityLabel;
	}
	public void setNationalityLabel(JLabel nationalityLabel) {
		this.nationalityLabel = nationalityLabel;
	}
	public JTextField getNameValue() {
		return nameValue;
	}
	public void setNameValue(JTextField nameValue) {
		this.nameValue = nameValue;
	}
	public JTextField getSurname() {
		return surname;
	}
	public void setSurname(JTextField surname) {
		this.surname = surname;
	}
	public JTextField getPatronymic() {
		return patronymic;
	}
	public void setPatronymic(JTextField patronymic) {
		this.patronymic = patronymic;
	}
	public JTextField getPassport() {
		return passport;
	}
	public void setPassport(JTextField passport) {
		this.passport = passport;
	}
	public JTextField getNationality() {
		return nationality;
	}
	public void setNationality(JTextField nationality) {
		this.nationality = nationality;
	}
	public JButton getOkBtn() {
		return okBtn;
	}
	public void setOkBtn(JButton okBtn) {
		this.okBtn = okBtn;
	}
	public String toString(){
		String res = "";
		res += "Name: " + getNameValue().getText() + "\n";
		res += "Surname: " + getSurname().getText() + "\n";
		res += "Patronymic: " + getPatronymic().getText() + "\n";
		res += "Passport: " + getPassport().getText() + "\n";
		res += "Nationality: " + getNationality().getText() + "\n";
		return res;
	}
	/**
	 * 
	 */
	private static final long serialVersionUID = -7632657280662998882L;

}
